﻿using RSGZ.Business;
using RSGZ.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ChatOnline
{
    /// <summary>
    /// LoginCount 的摘要说明
    /// </summary>
    public class LoginCount : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            context.Response.Write("Hello World");


        }

        public void LoginCountPage()
        {
            string pageID = HttpContext.Current.Request.Form["pageID"];
            string ip = HttpContext.Current.Request.UserHostAddress;
            string city = BLL.GetAddrByIP.GetBaiduIp(ip);

            frmPageCountEntity entity = new frmPageCountEntity();
            entity.fldID = Guid.NewGuid();
            entity.fldCreateTime = DateTime.Now;
            entity.fldIP = ip;
            entity.fldPageID = pageID;
            entity.fldAddress = city;
            new frmPageCountBLL().InserForm(entity);
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}